import pandas as pd
matchpair=[['name', 'authorNationality'],['company_id', 'company_id']]
matchpairnum=2
matches2name="match_C_baseinfo_reginfo2"
df=pd.read_csv('D:/eclipse-workspace/DataIntergration/WebContent/output/'+matches2name+'.csv')
datadiscovery=df[(df['l_'+matchpair[0][0]]!=df['r_'+matchpair[0][1]])]
for i in range(1,matchpairnum):
    datadiscovery2=df[(df['l_'+matchpair[i][0]]!=df['r_'+matchpair[i][1]])]
    datadiscovery=pd.merge(datadiscovery,datadiscovery2, how='outer')
datadiscovery.drop([datadiscovery.columns[0]], axis=1, inplace=True)
print(datadiscovery)
datadiscoveryname=matches2name+"_discovery"
datadiscovery.to_csv('D:/eclipse-workspace/DataIntergration/WebContent/output/'+datadiscoveryname+'.csv', encoding='utf-8')